
package cn.hz.horse;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;

 

public class EzWatcher extends Thread {
 
    private final Object lock = new Object();

	private LinkedBlockingQueue qu; 
	public   void vaitNo(){
		synchronized (lock){ 
			try{
			
				lock.wait();
			}catch(Exception e){
				e.printStackTrace();
			}
		}
	}

	public void run(){
		while (true) {
           
                try{
                	 if(qu.size()>EzCfg.quSizeMax){
                		 Thread.sleep(1000);
                		 continue;
                		 //System.out.println("maxxxx");
                	 }else{
                		// System.out.println("minnnnn");
                	 }
                	 synchronized (lock) {
                		 //System.out.println("notifyAll.....");
                		 lock.notifyAll();
                	 }
                	 
                }catch(Exception e){
                	e.printStackTrace();
                }
                 // 閫氱煡鎵�鏈夌瓑寰呯殑鐢熶骇鑰�
           
          
        }
	}

	public LinkedBlockingQueue getQu() {
		return qu;
	}

	public void setQu(LinkedBlockingQueue qu) {
		this.qu = qu;
	}
	
}
